package cn.fl.ref.asspackinfo.transform;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.BeanUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.ref.asspackinfo.vo.AssPackInfoReplaceVO;
import fl.ref.asspackinfo.dto.AssPackInfoReplaceDTO;

public class AssPackInfoReplaceVOTransform {

	/**
	 * 资产包 DTO 转 VO
	 * @param dto
	 * @return
	 */
	public static AssPackInfoReplaceVO toVO(AssPackInfoReplaceDTO dto){
		AssPackInfoReplaceVO vo = null;
		if(dto != null){
			vo = new AssPackInfoReplaceVO();
			BeanUtils.copyProperties(dto, vo);
		}
		return vo;
	}
	
	/**
	 * 资产包 VO 转 DTO
	 * @param vo
	 * @return
	 */
	public static AssPackInfoReplaceDTO toDTO(AssPackInfoReplaceVO vo){
		AssPackInfoReplaceDTO dto = null;
		if(vo != null){
			dto = new AssPackInfoReplaceDTO();
			BeanUtils.copyProperties(vo, dto);
		}
		return dto;
	}
	
	/**
	 * 资产包 DTO集合 转 VO集合
	 * 
	 * @param list
	 * @return
	 */
	public static List<AssPackInfoReplaceVO> toVOList(List<AssPackInfoReplaceDTO> list){
		List<AssPackInfoReplaceVO> voList = new ArrayList<AssPackInfoReplaceVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for(AssPackInfoReplaceDTO dto : list){
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
	
}
